package com.mutable.app.mapper1;

import com.mutable.app.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper {

    @Insert("insert into user (name) values(#{name})")
    public boolean saveUser(User user);

    @Update("update user set name=#{name} where id=#{id}")
    boolean updateUser(User user);

    @Select("select * from user where id=#{id} limit 1")
    User findById(Integer id);
}
